package com.matt.foundation.vo.liveRecord;

import com.matt.domain.record.LiveRecord;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2017/8/3
 * *******************************
 */
@Data
public class RecordListVo {

    private String id;

    private String title;

    private String content;

    private Integer category;

    private String resourceUrl;

    private String thumbUrl;

    private Date created;

    private List<RecordChildVo> childrenList;

    private Integer mediaType ;

    private String operatorId;

    private String operatorName;

    private String headImgUrl ;


    public static RecordListVo of(LiveRecord liveRecord, List<RecordChildVo> childrenList) {
        RecordListVo vo = new RecordListVo();
        vo.setId(liveRecord.getId());
        vo.setTitle(liveRecord.getTitle());
        vo.setCategory(liveRecord.getCategory());
        vo.setContent(liveRecord.getContent());
        vo.setMediaType(liveRecord.getMediaType());
        vo.setResourceUrl(liveRecord.getResourceUrl());
        vo.setThumbUrl("");
        vo.setCreated(liveRecord.getCreated());
        vo.setChildrenList(childrenList);
        vo.setOperatorName(liveRecord.getOperatorName());
        vo.setOperatorId(liveRecord.getOperatorId());
        vo.setHeadImgUrl(liveRecord.getHeadImgUrl());

        return vo;
    }


}
